<?
function getOldUrl(){
$base_url= $_SERVER['PHP_SELF']; 
while(list($key, $value) = each($_GET)){		 
		$url= "?".$key."=".$value;	
		
	}	 
	return $base_url.$url;
}	
?>

 